home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / NNANS592.ARJ / NNANSI.DOC < prev    next >
Text File  |  1992-05-31  |  33KB  |  888 lines

  1.     NNANSI.SYS -- Enhanced MS-DOS ANSI Console Driver
  2.               For EGA/VGA Displays
  3.  
  4. Note: MS-DOS is a trademark of Microsoft Corporation.
  5. PC/XT, PC/AT, and PS/2 are trademarks of IBM Corporation.
  6. 4DOS is a trademark of J.P. Software.
  7. MKS Toolkit is a trademark of Mortice Kern Systems Inc.
  8. PROCOMM is a trademark of Datastorm Technologies, Inc.
  9. Typing Tutor IV is a trademark of Kriya Systems, Inc.
  10. Manufacturers' names are the trademarks of their respective manufacturers.
  11. That should take care of everyone.
  12.  
  13. Documentation for version 5/92.
  14.  
  15. This version of NNANSI.SYS contains the following improvements
  16. over NNANSI version 5/91.
  17.  
  18. 1. DOS 5.0 aware--COMMAND.COM now knows about NNANSI so that the CLS
  19.     command will work properly in modes other than 40/80 x 25.
  20.     
  21. 2. Enhanced handling of errors and enhanced fast, slow, biosw, and 
  22.    nobiosw files.
  23.  
  24. 3. ANSI bios write_tty can now be enabled/disabled at runtime.
  25.     Default is still disabled.
  26.  
  27. 4. Default for fast mode and graphics cursor are still both false.
  28.  
  29. 5. Additional display drivers, including TSENG 4000 based cards. 
  30.     VESA support.
  31.  
  32. 6. NNANSI will now work in CGA systems, and will also work in MDA or
  33.     dual display (MDA and CGA/EGA/VGA) systems when reassembled
  34.     for MDA support.
  35.  
  36. 7. Code for SGR (set graphics rendition) has been improved, and is
  37.     now more accurate.
  38.  
  39. *********INTRODUCTION
  40.  
  41. NNANSI.SYS (version 5/92) is an improved version of NANSI.SYS
  42. (version 2.2), by Daniel Kegel, which is in turn such an
  43. improvement over ANSI.SYS that *no one* should be without one of
  44. these.
  45.  
  46. If you are using ANSI.SYS, be aware that either of these drivers
  47. will offer greatly improved performance and functionality over
  48. your current driver. Current users of NANSI.SYS with EGA or VGA
  49. displays (and other enhanced ANSI.SYS drivers) will notice still
  50. greater performance and functionality in NNANSI.SYS.
  51.  
  52. Even if you don't use an ANSI.SYS driver, you will achieve major 
  53. performance benefits. (Note that there will be no performance
  54. benefits for programs that write directly to the display).
  55.  
  56.  
  57. A short list of improvements of NANSI.SYS (version 3.0) over
  58. ANSI.SYS: 
  59.  
  60. 1. Intrinsic 43 or 50 line support (MS-DOS 4.0 now has this).
  61.  
  62. 2. Some additional text mode escape sequences: Insert Lines,
  63.     Delete Lines, Insert Characters, Delete Characters.
  64.  
  65. 3. Greater to *much* greater performance.
  66.  
  67. 4. Supports higher resolutions, both text and graphic modes.
  68.  
  69. 5. Graphic mode cursor
  70.  
  71.  
  72. A short list of improvements of NNANSI.SYS (version 5/92) over
  73. NANSI.SYS:
  74.  
  75. 1. Additional escape sequences: erase to start/end of display,
  76.     insert/delete lines in graphic modes, added Set Graphic
  77.     Rendition codes (and properly working reverse video,
  78.     underline, and invisible modes).
  79.  
  80. 2. Graphic cursor support is better, and can be disabled.
  81.  
  82. 3. Intrinsic support for both 43 and 50 line modes on a VGA. The
  83.     prompt command can be used to maintain 43 or 50 line display
  84.     modes. 
  85.  
  86. 4. Faster text mode performance; *much* faster scrolling
  87.     (when in "fast mode").
  88.  
  89. 5. Much faster performance in 640x350 to 800x600 16 color
  90.     graphic modes. Every ANSI control sequence (except
  91.     insert/delete characters and blink) work in these modes
  92.     as well.
  93.  
  94. 6. Readily configured for enhanced graphic and text modes of
  95.     various display cards. Support for several popular cards
  96.     are provided.
  97.  
  98. 7. Blink in 16 color graphics modes (up to 800x600) will exclusive-OR
  99.     characters.
  100.  
  101. 8. Support for MS-DOS V4.0 and later MODE commands, and properly
  102.     clears the display in enhanced modes using command.com's CLS.
  103.  
  104.  
  105. On the other hand, NANSI is smaller, and works with MDA as distributed.
  106.  
  107.  
  108.  
  109. **********************LICENSE REQUIREMENTS
  110.  
  111. Daniel Kegel is the author of NANSI.SYS, of which this is a
  112. derived work. I, Tom Almy, think enough of his efforts and
  113. programming skills that I used NANSI.SYS as a base for
  114. NNANSI.SYS (version 2.2 came with sources and free distribution
  115. for personal or educational use, but prohibits commercial use).
  116. I have an agreement with Mr.  Kegel to license NNANSI.SYS in
  117. accordance with his newest NANSI.SYS license arrangement:
  118.  
  119. "If you use this program for education or at home, you are
  120. encouraged to send a US$10 donation to the author.  If you use
  121. it for business purposes, you are required to purchase a
  122. right-to-use license by sending US$10 to the author."
  123.  
  124. Send contributions/user fees to:
  125.  
  126.     Daniel Kegel
  127.     221 Fairview Ave.
  128.     South Pasadena, CA  91030
  129.  
  130. You can also reach him at his internet address:
  131.  
  132. dank@moc.jpl.nasa.gov
  133.  
  134.  
  135. Everyone wins with this arrangement!
  136.  
  137. * Commercial users can now legally use NNANSI.SYS
  138.  
  139. * Personal users can show their gratitude.
  140.  
  141. * Daniel Kegel can make a little money for his efforts.
  142.  
  143. * I won't feel guilty for "ripping off" his work.
  144.  
  145.  
  146. I place no restrictions on my modifications to NANSI.SYS. I
  147. neither request nor will I accept any contributions for my work
  148. on this program. I made these modifications as part of an effort
  149. to understand the workings of DOS device drivers and the EGA/VGA
  150. display. 
  151.  
  152. On the other hand, I do like to hear from users, satisfied or
  153. (even) not satisfied. 
  154.  
  155. >>>>Please, if you have problems, check the PROBLEMS section of this
  156. document before contacting me. Greater than 90% of the problem
  157. reports I receive are answered in this section.<<<<
  158.  
  159. My address is:
  160.  
  161.     toma@sail.labs.tek.com        (Internet)
  162.  
  163. or
  164.  
  165.     Tom Almy
  166.     17830 SW Shasta Trail
  167.     Tualatin, OR 97062
  168.  
  169. if you must use the postal service. Enclose a stamped, self-
  170. addressed envelope if you desire a reply.
  171.  
  172.  
  173.  
  174. *********DISTRIBUTED FILES
  175.  
  176. The distribution has the following files:
  177.  
  178.     nnansi.sys      - Driver, with compilation options set as shown
  179.             - in the file CONFIG.INC
  180.     nnansi.doc      - this file
  181.     gcon.bat        - turns graphic cursor on
  182.     gcoff.bat       - turns graphic cursor off
  183.     fast.bat        - turns fast mode on
  184.     slow.bat        - turns fast mode off
  185.     biosw.bat       - turns ANSI bios write_tty on
  186.     nobiosw.bat     - turns ANSI bios write_tty off
  187.     25.bat          - set 80x25 text mode
  188.     43.bat          - set 80x43 text mode
  189.     50.bat          - set 80x50 text mode (VGA only)
  190.  
  191.     dtest.exe       - Performance testing program for ANSI drivers
  192.     stat.com        - Print out information about display status
  193.  
  194.     makefile        - for Don Kneller's NDMAKE
  195.     nnansi.asm      - The source file
  196.     config.inc      - Configuration selections (part of source)
  197.     drivers.inc     - Display specific macros (part of source)
  198.  
  199.  
  200.  
  201. *********INSTALLATION
  202.  
  203. NNANSI.SYS installs just like ANSI.SYS (or NANSI.SYS), it is a
  204. device driver that you specify in your CONFIG.SYS file:
  205.  
  206.     DEVICE=NNANSI.SYS
  207.  
  208. If you are using code pages, place this command before the 
  209. DEVICE=DISPLAY.SYS command, otherwise code pages will not work.
  210.  
  211. For optimum performance, run fast.bat and biosw.bat, but if
  212. applications have trouble with either of these, you will have to
  213. revert back to slower operating modes (read section "FAST MODE").
  214.  
  215. While the supplied compiled driver is suitable for most
  216. installations, you can get better results by customizing the driver
  217. for your display card. To do this you will need an assembler, such as
  218. Borland Turbo Assembler, a text editor, and (optionally) Don
  219. Kneller's NDMAKE program. I understand that Borland's MAKE will also
  220. work.
  221.  
  222. Some people have asked why I don't have command line options for
  223. the driver or a separate configuring program but require the user to
  224. use an assembler. The reasons:
  225.  
  226. 1. These make the driver larger and possibly slower than it needs to be.
  227.    If you insist on a full-featured display driver try FANSI-CONSOLE.
  228. 2. I feel that users who are sophisticated enough to be able to utilize
  229.    NNANSI either have an assembler or have access to one. This is not
  230.    a program for novices.  
  231. 3. I'm lazy. I'm not interested. I've got other things to do (which pay).
  232.  
  233. All options are specified in the file CONFIG.INC. Edit that
  234. file and make changes as appropriate. These descriptions assume
  235. the initial default settings:
  236.  
  237. VGA     (TRUE)
  238.     If you have an EGA display, set this to FALSE. You might
  239.     also want to set this to FALSE if you have a VGA and are
  240.     used to the ESC [=43h sequence supplying 50 line mode.
  241.  
  242. EGA     (TRUE)
  243.     If you have a VGA, set this to FALSE.
  244.  
  245. VESA    (FALSE)
  246.     Set TRUE if you have a VESA compatible display card BIOS.
  247.     You will also need to have a particular display specified
  248.     for best results. VESA has been successfully tested with
  249.     a Diamond Speedstar card (TSENG4000 set TRUE) and using
  250.     Diamond's VESA BIOS extension. Best results should be
  251.     obtainable for systems having a built-in VESA BIOS (do any
  252.     exist???).
  253.  
  254. VEGA, PARADISE, STBVGA...  (all FALSE)
  255.     Set only one of these TRUE to match your enhanced
  256.     EGA/VGA display card. If you have a card not on the list
  257.     and experience problems with either blotches in enhanced
  258.     text mode or poor performance (unsettable background
  259.     colors is a clue) in graphics modes CONTACT THE AUTHOR.
  260.  
  261. MONO    (FALSE)
  262.     Must be TRUE if you have a Monochrome Display Adapter (MDA)
  263.     or Hercules card either as your sole display or in addition
  264.     to a color display controller. If you don't, leave this FALSE
  265.     as it both hurts performance and enlarges the driver.
  266.  
  267. cheap_pc (TRUE)
  268.     Set to FALSE for "PC/AT" and "PS/2" class machines which
  269.     have 80186 or greater processors.
  270.  
  271. key_redef (FALSE)
  272.     Set to TRUE if you use key redefinition. There are
  273.     Trojan Horse programs that take advantage of this
  274.     feature, and most people don't use it anyway, so the
  275.     default is FALSE.
  276.  
  277. init_buffer_size (256)
  278.     Enlarge if you use key redefinition and don't have
  279.     enough room.
  280.  
  281. quick_char (TRUE)
  282.     Faster graphics display in 16 color modes, at cost of
  283.     much extra code since this involves added display
  284.     routines. Must be TRUE if gbackground is also TRUE.
  285.  
  286. fast29  (TRUE)
  287.     Makes int29 display calls (used by DOS) 15% faster at a
  288.     cost of about 100 bytes.
  289.  
  290. bios_write_tty (TRUE)
  291.     The write tty BIOS call is taken over. It will now
  292.     perform faster and understand ANSI escape sequences. This
  293.     latter feature can be a mixed blessing. This feature can be
  294.     disabled at runtime if it is assembled in.
  295.  
  296. gbackground (TRUE)
  297.     Enables setting of non-black background color in 16 color
  298.     graphic modes (640x350 to 800x600 resolutions). If set to
  299.     TRUE, quick_char must also be set to TRUE. If this feature is
  300.     not desired, it is possible (depending on the system) to get
  301.     greater performance by defining both gbackground and
  302.     quick_char FALSE. This will also save quite a bit of
  303.     code. Experiment and see for yourself.
  304.  
  305. dos4 (TRUE)
  306.     Under MS/PC DOS version 4.0 (and 5.0) allows command.com and
  307.     mode.com to recognize NNANSI as an ANSI driver. If you are
  308.     using older DOS versions, you can define this to be FALSE.
  309.  
  310. initgc  (FALSE)
  311.     Graphic mode cursor is initially off. You can turn it on/off
  312.     with a control sequence.
  313.  
  314. initfast (FALSE)
  315.     Fast scroll mode is initially off. This also means that
  316.     multiple page support is initially on. You can turn it on/off
  317.     with a control sequence, and there are other work-arounds as
  318.     well.
  319.  
  320. initbiosw (FALSE)
  321.     ANSI bios write_tty is initially off. You can turn it on/off
  322.     with a control sequence.
  323.  
  324.  
  325. You can then either use the supplied makefile to generate a new
  326. nnansi.sys or assemble manually as shown (Borland tools
  327. illustrated): 
  328.  
  329. tasm /m5 nnansi                 (Use /m5 for version 2.0 or later)
  330. tlink nnansi,nnansi.sys/m/t
  331.  
  332. With the Microsoft assembler, you will need to make some changes to
  333. the source to avoid the branch out of range errors, and you will need
  334. to use the exe2bin program to convert the linker generated exe file
  335. into a binary image file, which you then have to rename to
  336. NNANSI.SYS.
  337.  
  338.  
  339. **************HOW MUCH PERFORMANCE IMPROVEMENT IS THERE?
  340.  
  341. I have performed considerable testing on an EVEREX 25Mhz 80386
  342. machine with a Video 7 (Headland) Fastwrite VGA display controller
  343. (and its BIOS), under both DOS 3.3 and 4.0. Your results will
  344. probably vary, and BIOS performance without NNANSI.SYS will also
  345. improve if the EGA/VGA BIOS is copied to RAM as supported by some
  346. vendors and also possible with QEMM or 386/MAX on 80386 based systems.
  347.  
  348. Performance is proportional to roughly independent factors, writing
  349. speed and scrolling speed. Writing speed is the rate at which
  350. characters can be drawn on the display without the display scrolling.
  351. Scrolling speed is the rate at which the display can scroll (no
  352. new characters are drawn). Writing speed tends to be independent of
  353. display mode (except graphic modes are slower), while scrolling speed
  354. tends to be proportional to the number of character positions on the
  355. display (except for NNANSI fast mode, which is independent of screen
  356. size). 
  357.  
  358. When using ANSI.SYS rather than no driver at all, there is roughly a
  359. 2.3x degradation in performance for writing. Scrolling performance
  360. improves 44% when DOS 4.0 ANSI driver is used, but remains unchanged
  361. with the DOS 3.3 driver.
  362.  
  363. Compared to no driver, NANSI.SYS (3.0) is 3x to 3.5x faster for
  364. writing, and is roughly 45x faster when writing using DOS in RAW
  365. mode. It is roughly 2x faster scrolling.
  366.  
  367. Compared to the no driver or other ANSI drivers, NNANSI.SYS is 4x
  368. faster in BIOS TTY write calls. 
  369.  
  370. Compared to NANSI.SYS it is 2x faster in INT29 calls, 73% faster in
  371. DOS write calls, but there is no speedup in RAW mode. When fast mode
  372. is used, scrolling is 15x to 25x faster.
  373.  
  374. This means that text mode programs that take advantage of RAW
  375. mode and buffering can display 100 times faster with NNANSI (and
  376. without scrolling, NANSI) over ANSI.SYS. It works out to about
  377. 420,000 characters per second with my fast machine.
  378.  
  379. NNANSI.SYS also has speedups for 16 color graphic modes with
  380. resolutions between 640x350 and 800x600. With the graphic cursor
  381. turned on, the TTY BIOS call is about 10% slower than the standard
  382. BIOS call (which doesn't display a cursor), but other output calls
  383. are 2.5x to 3.5x faster than that of NANSI.SYS. Turning the graphics
  384. cursor off roughly doubles the writing speed of all modes but RAW.
  385.  
  386.  
  387.  
  388. **************FAST MODE  **READ THIS!!**
  389.  
  390. To get maximum speed, NNANSI has what I call Fast Mode. In text
  391. mode, there is more display memory than there are character on
  392. the display. Normally, the BIOS supports display "pages" that you
  393. can switch among. Changing the display page changes the region
  394. of the display memory that is sent to the display. Fast Mode
  395. uses the same technique (changing the starting location of the
  396. viewable memory region) to scroll the display upwards. 
  397.  
  398. Programs that make use of multiple display pages and scroll the
  399. display require that fast mode be turned off. Many debugging programs
  400. use two pages to maintain separate debugging and application
  401. displays. Some of the programs will still work in fast mode if they
  402. have a "swap screens" option ("-ds" for Borland Turbo Debugger, for
  403. instance).
  404.  
  405. A number of programs that directly access the display don't work if
  406. starting address has changed. These programs may not work properly in
  407. fast mode (or for that matter in display pages other than the first).
  408. NNANSI.SYS tries its best to work with these programs by resetting
  409. the display start location if any program does the "get display mode"
  410. or "scroll/clear display" BIOS calls. These calls are typically done
  411. by potentially offending applications when they start. As long as the
  412. display never scrolls under NNANSI.SYS control everything will work
  413. fine. A typical problem occurs in programs that have DOS or "shell
  414. escape" commands. If the DOS sub-shell (invocation of COMMAND.COM)
  415. causes the display to scroll, then upon exiting the sub-shell the
  416. display will be ruined. The solution to this problem (other than not
  417. using fast mode) is to clear the screen just before exiting the
  418. sub-shell.
  419.  
  420. Please note that Windows 3.0 in Enhanced Mode has problems with DOS
  421. applications running in a window using NNANSI's fast mode. You will
  422. need to run Windows with NNANSI in slow mode.
  423.  
  424. Some offending programs can be "fixed" by invoking them from a
  425. batch file (or alias if you use MKS Toolkit, 4DOS, ANARKEY...)
  426. which first clears the screen. Or you can use a batch file which
  427. turns off fast mode, then turn fast mode back on again after
  428. program execution. Example:
  429.  
  430. echo ^[[=98l
  431. offendingpgm %1 %2 %3 %4 %5
  432. echo ^[[=98h
  433.  
  434. Where "^[" is the escape (code 27) character.
  435.  
  436. Batch programs have been provided to enable (fast.bat) and disable
  437. (slow.bat) fast mode.
  438.  
  439.  
  440. NNANSI.SYS can also speed up programs that use BIOS calls for writing
  441. characters. NNANSI.SYS adds the ANSI features to such calls, which
  442. can cause problems with some applications. This feature is turned off
  443. by default, but can be enabled via an ANSI sequence or by executing
  444. the supplied batch file biosw.bat. The feature can be disabled with
  445. nobiosw.bat.
  446.  
  447.  
  448. ******************WRITING PROGRAMS FOR BEST PERFORMANCE
  449.  
  450.  
  451. To get best performance in programs you write, you must put the
  452. display in RAW mode, and buffer output.
  453.  
  454. In assembler, you can set raw mode with the following sequence
  455. (adapt this for other languages):
  456.  
  457.     mov     ax,4400h        ; get device status
  458.     mov     bx, 1           ; of device 1 (standard output)
  459.     int     21h
  460.     xor     dh, dh          ; clear upper byte
  461.     mov     saved_state, dx ; save it for later
  462.     mov     ax, 4401h       ; set new status
  463.     or      dl, 20h         ; with raw bit set
  464.     int     21h
  465.  
  466. Reset raw mode before terminating the application:
  467.  
  468.     mov     ax, 4401h       ; set status to original values
  469.     mov     bx, 1
  470.     mov     dx, saved_state
  471.     int     21h
  472.  
  473. There is a fixed amount of overhead (and it is high) for each
  474. DOS call. Therefore you should buffer up write requests into a
  475. single call. With the C language, you can use the setvbuf() call
  476. to set a large buffer size.
  477.  
  478. Even if you don't follow this advice, you will get a major
  479. performance improvement over ANSI.SYS (or no device driver at
  480. all). 
  481.  
  482. Programs using RAW mode and buffering easily beat the
  483. performance of the supposedly high speed console drivers
  484. supplied in Turbo C and Microsoft C. And by using ANSI control
  485. sequences your programs can be made portable to other systems!
  486.  
  487.  
  488. *****************TYPICAL PROBLEMS
  489.  
  490.  
  491. ALSO READ THE SECTION "FAST MODE"
  492.  
  493.  
  494. SYSTEM CRASHES UPON BOOTING, OR DISPLAY BADLY CORRUPTED EVEN IN
  495. STANDARD 80x25 TEXT MODE.
  496.  
  497. You have assembled NNANSI.SYS with cheap_pc set to FALSE on an 8088
  498. based system, or you are trying to use NNANSI.SYS on an MDA or
  499. Hercules Graphics equipped system without reassembling with MONO
  500. equal TRUE.
  501.  
  502.  
  503. ON A VGA, SETTING 43 LINE MODE GIVES 43 LINES, WHEN IT GAVE 50
  504. WITH AN OLDER VERSION OF NNANSI.SYS OR WITH NANSI.SYS
  505.  
  506. This is correct. There is now a new setting for 50 line mode. If
  507. you require that 43 line mode give 50 lines, recompile the
  508. system with VGA set to FALSE.
  509.  
  510.  
  511. I USED AN EARLIER VERSION OF NNANSI, AND NOW I FIND THAT NNANSI IS
  512. MUCH SLOWER THAN BEFORE
  513.  
  514. The defaults have changed. You now have to run FAST and BIOSW for
  515. fastest operation.
  516.  
  517.  
  518. I USED AN EARLIER VERSION OF NNANSI, AND NOW FIND MY DISPLAY 
  519. INEXPLICABLY CHANGING MODES
  520.  
  521. The commands for graphic cursor, fast mode, and line wrap are 
  522. more restrictive. Use the new batch files for fast, slow, gcon, and
  523. gcoff, and change any code of your own appropriately.
  524.  
  525.  
  526. ON A VGA, SETTING 50 LINE MODE CAUSES VERY STRANGE BEHAVIOR
  527.  
  528. Two possibilities. Your display adapter is really an EGA, or you
  529. have compiled NNANSI.SYS with VGA set to FALSE. In the latter
  530. case, you can get 50 line mode by setting 43 line mode, while in
  531. the former case you can't get 50 line mode at all.
  532.  
  533.  
  534. ON A VGA, AFTER LEAVING 43/50 LINE MODE THE CURSOR IS IN THE
  535. MIDDLE OF THE CHARACTER BLOCK
  536.  
  537. Recompile the driver with EGA set to FALSE.
  538.  
  539.  
  540. ON AN EGA, THE CURSOR DISAPPEARS IN 43 LINE MODE WHEN RUNNING
  541. SOME APPLICATIONS
  542.  
  543. There is nothing you can do, as this is caused by an error in
  544. the design of the EGA BIOS.
  545.  
  546.  
  547. IN 43/50 LINE MODE, THE DOS CLS COMMAND ONLY CLEARS THE FIRST 25
  548. LINES OF THE DISPLAY (DOS 4.0)
  549.  
  550. Reassemble with "dos4 EQU TRUE", as it is in the distribution NNANSI
  551. driver.
  552.  
  553.  
  554. DISPLAY SHOWS UGLY BLOCKS AT THE START AND END OF EACH LINE OR
  555. PERFORMANCE SLOWS GREATLY IN EXTENDED (GREATER THAN 80X25) TEXT MODES 
  556.  
  557. Your display controller sets the display mode byte in the BIOS to
  558. some value other than "3". You can either set the byte (at location
  559. 40:49h) back to 3 after setting the display mode, or configure
  560. NNANSI.SYS to know about these special modes. This problem is typical
  561. for most cards, it seems. There may already be a proper configuration
  562. for your display in CONFIG.INC. 
  563.  
  564.  
  565. DISPLAY IS NOTICEABLY SLOWER WRITING OR CANNOT SWITCH BACKGROUND
  566. COLORS IN EXTENDED (GREATER THAN 640x480, OR 640x350 EGA)
  567. GRAPHIC MODES
  568.  
  569. In 256 color modes or 1024x768 modes, the background color cannot be
  570. changed. In other modes, you will need to configure NNANSI.SYS for
  571. your display card.  Look for a proper configuration in CONFIG.INC.
  572.  
  573.  
  574. DISPLAY GOES BLANK WHEN STARTING AN APPLICATION. DISPLAY SHIFTED
  575. PARTLY OFF SCREEN WHEN STARTING AN APPLICATION. DISPLAY
  576. DISAPPEARS DURING EXECUTION OF A APPLICATION.
  577.  
  578. First try clearing the screen before execution. If that doesn't
  579. work, leave fast mode (see preceding section on FAST MODE).
  580.  
  581.  
  582. FUNNY BLOTCHES OCCASIONALLY APPEAR AT VARIOUS POINTS IN A
  583. GRAPHIC APPLICATION
  584.  
  585. This is the graphics cursor. You can disable it either by
  586. reconfiguring the driver, or by sending the control sequence to
  587. disable the graphics cursor. A batch file, GCOFF.BAT, has been 
  588. provided for this purpose.
  589.  
  590.  
  591. TEXT DISPLAY IS MESSED UP, POSSIBLY CHANGING COLORS IN UNUSUAL
  592. PLACES. 
  593.  
  594. This has been observed with programs using the BIOS for writing
  595. to the display, and not expecting the ANSI translation (or the
  596. conversion of the TAB character into spaces instead of a special
  597. graphic). Execute NOBIOSW.BAT to turn the ANSI translation off
  598. for these programs.  PROCOMM and Typing Tutor IV have this problem.
  599.  
  600.  
  601. CANNOT SET VESA STANDARD EXTENDED DISPLAY MODES
  602.  
  603. You must compile the driver with VESA defined as TRUE, and then
  604. must request a mode 128 less than that really desired.
  605.  
  606.  
  607. *****************NNANSI COMMAND SEQUENCES
  608.  
  609. Command sequences start with the escape character (code 27,
  610. referred to in this section as ESC). NNANSI buffers up the
  611. sequence until it has a command to execute. If the sequence is
  612. not a valid command, the entire sequence is passed to the display.
  613.  
  614. All command sequences have the following format:
  615.  
  616.    ESC [ param1; param2; ...; paramN cmdchar
  617.  
  618. where
  619.        ESC     is the escape character
  620.        [       is the left bracket character.
  621.        param   are ascii decimal numbers or quoted strings.
  622.        cmdchar is the command character
  623.  
  624. No spaces are allowed within the command.
  625.  
  626. Omitted parameters default to "1", with the exception of the ED
  627. (erase in display) command. For example, both ESC[1;1H and ESC[H
  628. send the cursor to the home position (1,1), which is the upper
  629. left.
  630.  
  631. Quoted strings may use either single or double quote characters
  632. as delimiters. Each character inside the quoted string is
  633. converted to a numeric parameter. Quoted strings are only useful
  634. for the questionable Keyboard Key Reassignment command.
  635.  
  636.  
  637.  
  638.            CURSOR POSITIONING COMMANDS
  639.  
  640. NAME    DESCRIPTION             COMMAND
  641. CUP     cursor position         ESC[y;xH
  642. HVP     cursor position         ESC[y;xf
  643.  
  644.     Either of these set the cursor position. CUP should be
  645.     used since HVP has other connotations not implemented in
  646.     NNANSI.SYS (or ANSI.SYS). The origin (in the upper left
  647.     corner) is x=1, y=1.
  648.  
  649. CUU     cursor up               ESC[nA
  650. CUD     cursor down             ESC[nB
  651.     n = # of lines to move. You cannot move beyond the edge
  652.     of the display.
  653.  
  654. CUF     cursor forward          ESC[nC
  655. CUB     cursor backward         ESC[nD
  656.     n = # of columns to move. You cannot move beyond the
  657.     edge of the display.
  658.  
  659. DSR     Device Status Report    ESC[6n
  660.     Find out cursor position. The driver responds with a
  661.     cursor position report (CPR) of the form "ESC[y;xR"
  662.     followed by a carriage return, as if typed at the
  663.     keyboard. 
  664.  
  665. SCP     Save Cursor Position    ESC[s
  666. RCP     Restore Cursor Position ESC[u
  667.     Cannot be nested.
  668.  
  669.  
  670.  
  671.  
  672.             EDITING COMMANDS
  673.  
  674. NAME    DESCRIPTION             COMMAND
  675. ED      Erase in Display        ESC[nJ
  676.     n=0 or missing: Erase to end of screen (not in ANSI.SYS)
  677.     n=1: erase to start of screen (not in ANSI.SYS)
  678.     n=2: erase entire screen, and home cursor
  679.     Note: there is a bug in ANSI.SYS that performs function
  680.     2 regardless of the value of n. This bug is not repeated
  681.     in NNANSI.SYS because of the extra functionality provided.
  682.     Everybody's "ANSI.SYS" homes the cursor, which the standard
  683.     does not call for, and NNANSI keeps up that tradition.
  684.  
  685. EL      Erase in Line           ESC[K
  686.     Erases from cursor to end of line
  687.  
  688. IL      Insert Lines            ESC[nL 
  689.     Inserts n blank lines at the line containing the cursor.
  690.     While the cursor line moves down, the cursor position is
  691.     unchanged. Not in ANSI.SYS. 
  692.  
  693. DL      Delete Lines            ESC[nM  
  694.     Deletes n lines, starting at the line containing the
  695.     cursor. The cursor is not moved. Not in ANSI.SYS
  696.     
  697. ICH     Insert Characters       ESC[n@  
  698.     Inserts n blank characters at cursor position. The
  699.     cursor does not move. Not in ANSI.SYS. Does not work in
  700.     graphic modes.
  701.  
  702. DCH     Delete Characters       ESC[nP  
  703.     Deletes n characters at the cursor. The cursor does not
  704.     move. Not in ANSI.SYS. Does not work in graphic modes.
  705.  
  706.  
  707.  
  708.  
  709.           SET GRAPHIC RENDITION COMMAND
  710.  
  711. NAME    DESCRIPTION             COMMAND
  712. SGR     Set Graphics Rendition  ESC[n;n;...nm
  713.  
  714. The Set Graphics Rendition command is used to select foreground
  715. and background colors or attributes.  When you use multiple
  716. parameters, they are executed in sequence, and the effects are
  717. cumulative.  You can set all colors and attributes in any text
  718. mode.  In 16 color graphic modes between 640x350 and 800x600
  719. pixels you can set all colors and attributes except for blink.
  720. "Blink" becomes exclusive-OR character mode (very useful!).  You
  721. can set foreground colors, blink, and bold, only, in other 16 color
  722. modes.  Setting colors does not work correctly for other color
  723. modes -- make sure display is in the normal white on black mode
  724. before changing to these modes.
  725.  
  726. When a Monochrome Display Adapter (MDA) is used, foreground and
  727. background colors other than black and white should not be set. The
  728. MDA also ignores the underscore and bold attributes while in reverse
  729. video.
  730.  
  731.  
  732. Code          Value
  733. 0               All attributes off (normal white on black)
  734. 1               Bold
  735. 2               Dim (not Bold)
  736. 4               Underscore (emulated via blue foreground in CGA/EGA/VGA)
  737. 5               Blink (or EXOR -- see above)
  738. 7               Reverse Video (improved implementation over ANSI)
  739. 8               Invisible (improved operation -- foreground color
  740.         forced to background color, other attributes suppressed)
  741. 22              Cancel Bold
  742. 24              Cancel Underline (white foreground)
  743. 25              Cancel Blink
  744. 27              Cancel Reverse video
  745. 28              Cancel Invisible
  746. 30-37           foreground black/red/green/yellow/blue/magenta/cyan/white
  747. 40-47           background black/red/green/yellow/blue/magenta/cyan/white
  748.  
  749. Codes 2, 22, 24, 25, 27, and 28 are not in ANSI.SYS.
  750.  
  751.  
  752.  
  753.             SET DISPLAY MODE COMMAND
  754.  
  755. NAME    DESCRIPTION             COMMAND
  756. SM      Set Mode                ESC[=nh
  757. RM      Reset Mode              ESC[=nl
  758.  
  759. The set and reset mode commands are identical in this context.
  760.  
  761. The BIOS supports many video modes. The code given for the AL
  762. register to the BIOS set mode command is used as the parameter to
  763. this set mode command. That means that extended modes that are
  764. settable in this manner can use this command. As an example, with the
  765. Diamond Speedstar, the command ESC[=34h will set 132 column by 44 row
  766. mode. Display cards that use other techniques to change display mode
  767. are left as an exercise to the user, but if you can get the card into
  768. an extended mode, NNANSI can used it (possibly with a configuration
  769. change, though).
  770.  
  771. VESA Display Cards: To set VESA modes, select a mode 128 less than the
  772. desired mode number. For instance, for 132x43 text mode, select mode
  773. 138 (rather than 266). 
  774.  
  775. Monochrome Display Adapter (MDA): These commands are ignored when the
  776. MDA is in use.
  777.  
  778. In the graphic modes, the cursor can be simulated with a blob
  779. (the character produced with character code 22).
  780.  
  781. Mode Code       Value
  782.     0,1         text 40x25 16 color
  783.     2,3         text 80x25 16 color
  784.     4,5         graphics 320x200 4 color
  785.     6           graphics 640x200 Black & White
  786.     7           cursor wrap (see SET DISPLAY ATTRIBUTES, below)
  787.     13          graphics 320x200 16 color, VGA only
  788.     14          graphics 640x200 16 color, VGA only
  789.     16          graphics 640x350 16 color, VGA only
  790.     17          graphics 640x480 Black & White, VGA only
  791.     18          graphics 640x480 16 color, VGA only
  792.     19          graphics 300x200 256 color, VGA only
  793.     43          43 line mode for modes 0-3 (Not in ANSI.SYS)
  794.     50          50 line mode for modes 0-3 (VGA only, not in
  795.         ANSI.SYS)
  796.     n           When not in above list, sets mode n. (Not in
  797.         ANSI.SYS) 
  798.  
  799.  
  800. The modes marked as VGA only are not supported by ANSI.SYS
  801. that comes with version 3.3 MS-DOS or earlier.
  802.  
  803. The 43 line and 50 line support reprograms the display to use smaller
  804. characters. You must be in mode 3 (80x25) or 1 (40x25) for this
  805. command to work. Set any other mode to leave 43/50 line mode.
  806.  
  807. Unlike earlier versions of NNANSI.SYS, and NANSI.SYS, setting 43 line
  808. mode on a VGA will give 43 (not 50) lines. You must use the explicit
  809. 50 line mode command to get 50 lines on a VGA. If you would rather
  810. have compatibility with these other, earlier drivers, recompile the
  811. driver with VGA set to FALSE.
  812.  
  813. You can have 43 line mode automatically selected at the DOS
  814. prompt by issuing this command:
  815.  
  816.     prompt $e[=43h$p$g
  817.  
  818. Under MS/PC DOS Version 4.0 (or later?), the number of lines can
  819. also be set using the MODE command. For instance, to set 43 line mode
  820. under DOS 4.0, issue the command:
  821.  
  822.     mode con lines=43
  823.  
  824.  
  825. Note that in older versions of NNANSI.SYS, and NANSI.SYS, the use of
  826. the = character in the command was optional, and a ? could be used
  827. instead. That is not true for this version.
  828.  
  829.  
  830.              SET DISPLAY ATTRIBUTES
  831.  
  832. NAME    DESCRIPTION             COMMAND
  833. SM      Set Mode                ESC[?nh
  834. RM      Reset Mode              ESC[?nl
  835.  
  836. Valid attributes that can be set and reset:
  837.  
  838. 7       Cursor Wrap     When false, cursor sticks at end of
  839.             line, rather than wrapping
  840.  
  841. 97      ANSI Bios       When true, calls of the bios write_tty
  842.             function will be processed by NNANSI.SYS,
  843.             allowing processing of ANSI escape sequences.
  844.             When false, processing will not occur. Some
  845.             programs will not work properly if set to true.
  846.  
  847. 98      Fast Scroll     When true (fast mode) the starting
  848.             display location is changed for fast
  849.             scrolling, which can cause problems for
  850.             some programs. When false, the starting
  851.             location does not change and the
  852.             multi-page support is enabled.
  853.  
  854. 99      Graphic cursor  When true the cursor is displayed in
  855.             graphic modes. Some programs produce ghost
  856.             cursors when set to true.
  857.  
  858. Batch files are supplied to change attributes 97, 98, and 99.
  859.  
  860. Note that the Fast Scroll attribute does not apply to the Monochrome
  861. Display Adapter (MDA). Also note that in older versions of
  862. NNANSI.SYS, and NANSI.SYS, the use of the ? character in the command
  863. was optional, and an = could be used instead. That is not true for
  864. this version. Because some Microsoft documentation claims that the
  865. = character can be used for Cursor Wrap, NNANSI still supports that
  866. bug.
  867.  
  868.  
  869.  
  870.           KEYBOARD REASSIGNMENT COMMAND
  871.  
  872. This command is absent by default. You must recompile to enable
  873. this command. Use of this feature is not recommended.
  874.     
  875. NAME    DESCRIPTION             COMMAND
  876. IBMKKR  Keyboard Key Reassign   ESC[param;param;...;param p
  877.  
  878. If no parameters are given, all keys are reset. This is not true
  879. for ANSI.SYS.
  880.  
  881. The first parameter is the key to reassign. IBM function keys
  882. take the first two parameters, where the first parameter is 0.
  883. The remaining parameters are the keystrokes to substitute. F11
  884. and F12 are not supported. Normally a string is used rather than
  885. numeric arguments.
  886.  
  887. ******************************THE END****************************
  888.